/**
 * Created on Apr 23, 2007
 */
package jvs.vfs;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;
import java.util.Enumeration;
import java.util.List;
/**
 * 
 * @author qiangli
 * 
 */
public class VfsClassLoader extends URLClassLoader {

	public VfsClassLoader(URL[] urls) {
		super(urls);
	}

	public VfsClassLoader(URL[] urls, ClassLoader parent,
			URLStreamHandlerFactory factory) {
		super(urls, parent, factory);
	}

	public VfsClassLoader(URL[] urls, ClassLoader parent) {
		super(urls, parent);
	}


	public VfsClassLoader(List<URL> list) {
		super((URL[])list.toArray(new URL[0]));
	}

	public VfsClassLoader(List<URL> list, ClassLoader cl) {
		super((URL[])list.toArray(new URL[0]),cl);
	}

	public URL getResource(final String name) {
		URL u = VfsClassLoader.super.findResource(name);
		//Log.log(Log.TRACE,this," name: "+name+" "+u);
		return u;
	}

	public URL findResource(String name) {
		URL u = super.findResource(name);
		//Log.log(Log.TRACE,this," name: "+name+" "+u);
		return u;
	}

	public Enumeration<URL> findResources(String name) throws IOException {
		Enumeration<URL> en = super.findResources(name);
		//Log.log(Log.TRACE,this," name: "+name+" "+en);
		return en;
	}

	public InputStream getResourceAsStream(final String name) {
		InputStream is = VfsClassLoader.super.getResourceAsStream(name);
		//Log.log(Log.TRACE,this," name: "+name+" "+is);
		return is;
	}
	
}
